﻿@model AP.Framework.Infrastructure.Entities.cms_Link
@Html.ValidationSummary(true)
<script type="text/javascript">
    $(function () {       
        $('#file_upload').uploadify({
            'swf': '@Url.Content("~/Content/themes/uploadify/uploadify.swf")',
            'buttonText': '添加图片...',
            'cancelImg': '@Url.Content("~/Content/themes/uploadify/uploadify-cancel.png")',
            'uploader': '/Admin/Links/Upload',
            'auto': true,
            'onUploadSuccess': function (file, data, response) {
                eval("data=" + data);
                $("#ImageUrl").val(data.msg);
                $("#linkLogImage").attr("src", data.msg);
            }
        });
        $("#linkLogImage").attr("src", $("#ImageUrl").val());
    });      
</script>
<div class="control-group">
    <label class="control-label">
        标题</label>
    <div class="controls">
        @Html.TextBoxFor(model => model.Title, new { @placeholder = "标题" })
        @Html.ValidationMessageFor(model => model.Title)
    </div>
</div>
<div class="control-group">
    <label class="control-label">
        合作用户</label>
    <div class="controls">
        @Html.TextBoxFor(model => model.UserName, new { @placeholder = "合作用户" })
        @Html.ValidationMessageFor(model => model.UserName)
    </div>
</div>
<div class="control-group">
    <label class="control-label">
        联系电话</label>
    <div class="controls">
        @Html.TextBoxFor(model => model.UserTel, new { @placeholder = "联系电话" })
        @Html.ValidationMessageFor(model => model.UserTel)
    </div>
</div>
<div class="control-group">
    <label class="control-label">
        邮箱</label>
    <div class="controls">
        @Html.TextBoxFor(model => model.Email, new { @placeholder = "邮箱" })
        @Html.ValidationMessageFor(model => model.Email)
    </div>
</div>
<div class="control-group">
    <label class="control-label">
        网站/网址</label>
    <div class="controls">
        @Html.TextBoxFor(model => model.SiteUrl, new { @placeholder = "网站/网址" })
        @Html.ValidationMessageFor(model => model.SiteUrl)
    </div>
</div>
<div class="control-group">
    <label class="control-label">
        图片/Logo</label>
    <div class="controls">
        @Html.TextBoxFor(model => model.ImageUrl, new { @placeholder = "图片/Logo" })
        <input type="file" name="file_upload" id="file_upload" />
        <img id="linkLogImage" alt="logo" src="" style="" />
        @Html.ValidationMessageFor(model => model.ImageUrl)
    </div>
</div>
<div class="control-group">
    <label class="control-label">
        排序号</label>
    <div class="controls">
        @Html.TextBoxFor(model => model.Sequence, new { @placeholder = "排序号" })
        @Html.ValidationMessageFor(model => model.Sequence)
    </div>
</div>
<div class="control-group">
    <label class="control-label">
        是否隐藏/锁定</label>
    <div class="controls">
        <label class="checkbox">
            @Html.CheckBoxFor(model => model.IsDisable)
            @Html.ValidationMessageFor(model => model.IsDisable)
        </label>
    </div>
</div>
<div class="control-group">
    <div class="controls">
        <button type="submit" class="btn">
            保 存</button>
    </div>
</div>
